Sound channel components provide a number of functions that allow sequence grabber components to configure the component's sound channel. This section describes these sound channel configuration functions. The sequence grabber component uses these functions only with sound channels.
The SGSetChannelVolume function allows the sequence grabber component to control a channel's sound volume. The sequence grabber component uses the SGGetChannelVolume function to determine a channel's volume.
The SGSetSoundInputDriver specifies a channel's sound input device. The sequence grabber component can determine a channel's sound input device by calling the SGGetSoundInputDriver function. If an application changes any attributes of the sound input device, the sequence grabber component notifies your sound component by calling the SGSoundInputDriverChanged function.
The sequence grabber component can control the amount of sound data your channel works with at one time by calling the SGSetSoundRecordChunkSize function. The sequence grabber component can determine this value by calling the SGGetSoundRecordChunkSize function.
The sequence grabber component controls the rate at which your sound channel samples the input data by calling the SGSetSoundInputRate function. The sequence grabber component can determine the sample rate by calling the SGGetSoundInputRate function.
The sequence grabber can control other sound input parameters by using your SGSetSoundInputParameters and SGGetSoundInputParameters functions.
The SGSetChannelVolume function sets your channel's sound volume.
pascal ComponentResult SGSetChannelVolume (SGChannel c,
short volume);
The SGGetChannelVolume function allows the sequence grabber component to determine your channel's sound volume setting.
pascal ComponentResult SGGetChannelVolume (SGChannel c,
short *volume);
Some sound channel components may use sound input devices to obtain their source data. The SGSetSoundInputDriver function allows the sequence grabber component to assign a sound input device to your sound channel.
pascal ComponentResult SGSetSoundInputDriver (SGChannel c,
ConstStr255Param driverName);
If your sound channel component does not use sound input devices, return a nonzero result code.
The SGGetSoundInputDriver function allows the sequence grabber component to determine the sound input device currently in use by your sound channel component.
pascal long SGGetSoundInputDriver (SGChannel c);
The sequence grabber component may want to gain access to the sound input device if it wants to change the device's configuration. For example, the sequence grabber component may want to configure the device for stereo sound. If the sequence grabber component changes any of the device's operating parameters, it informs your sequence grabber channel component by calling your SGSoundInputDriverChanged function, which is described in the next section.
The SGGetSoundInputDriver function returns a reference to the sound input device. If your sound channel is not using a sound input device, set the returned value to nil .
The SGSoundInputDriverChanged function allows the sequence grabber component to notify your sound channel component whenever an application changes the configuration of your sound channel's sound input device.
pascal ComponentResult SGSoundInputDriverChanged (SGChannel c);
During record operations, the sequence grabber component and its sound channels work with groups of sound samples. These groups are referred to as chunks . By default, each chunk contains two seconds of sound data. Smaller chunks use less memory.
pascal ComponentResult SGSetSoundRecordChunkSize (SGChannel c,
long seconds);
The sequence grabber component can control the amount of sound data in each chunk by calling the SGSetSoundRecordChunkSize function. The sequence grabber component specifies the number of seconds of sound data your channel is to work with at a time.
The SGGetSoundRecordChunkSize function allows the sequence grabber component to determine the amount of sound data your sound channel component works with at a time.
pascal long SGGetSoundRecordChunkSize (SGChannel c);
The SGSetSoundInputRate function allows the sequence grabber component to set the rate at which your sound channel obtains its sound data.
pascal ComponentResult SGSetSoundInputRate (SGChannel c,
Fixed rate);
The SGGetSoundInputRate function allows the sequence grabber component to determine the rate at which your sound channel is collecting sound data .
pascal Fixed SGGetSoundInputRate (SGChannel c);
The SGSetSoundInputParameters function allows the sequence grabber to set some parameters that relate to sound recording.
pascal ComponentResult SGSetSoundInputParameters (SGChannel c,
short sampleSize,
short numChannels,
OSType compressionType);
Sequence grabbers may use the SGSetSoundInputParameters function to control many parameters relating to sound recording. All of the sound parameters support two special values. If any of these parameters are set to 0, your channel should not change the current value of that parameter. If any are set to -1, return that parameter to its default value.
If your sound device cannot support a specified parameter value, return an appropriate Sound Manager result code.
The SGGetSoundInputParameters function allows the sequence grabber to retrieve some parameters that relate to sound recording.
pascal ComponentResult SGGetSoundInputParameters (SGChannel c,
short *sampleSize,
short *numChannels,
OSType *compressionType);